<template>
  <e-table
    ref="eTable"
    @getList="handleGetList"
    :tableData="tableData"
    :columns="columns"
    :loading="loading"
    :pageObj="null"
  ></e-table>
</template>

<script>
import { checkListDetailRecord } from '@/api/assetsNew'

export default {
  data() {
    return {
      tableData: [],
      loading: false,
      columns: [
        {
          label: '盘点计划名称',
          prop: ''
        },
        {
          label: '盘点状态',
          prop: ''
        },
        {
          label: '盘点时间',
          prop: ''
        },
        {
          label: '盘点人',
          prop: ''
        },
        {
          label: '盘点方式',
          prop: ''
        },
        {
          label: '照片',
          prop: ''
        }
      ],
      queryParam: {
        pageSize: 10,
        pageNo: 1
      },
      mdl: {}
    }
  },

  methods: {
    edit(obj) {
      this.mdl = Object.assign({}, obj)
      this.handleGetList({ assetsId: obj.assetsId })
    },
    async handleGetList(param = {}) {
      this.loading = true
      this.queryParam = Object.assign(this.queryParam, param)
      const res = await checkListDetailRecord(this.queryParam)
      if (res && res.data.length > 0) {
        const { state, data } = res
        this.tableData = data
      } else {
        this.tableData = []
      }
      this.loading = false
    }
  }
}
</script>
